package com.graducationdesign.springboot.service.impl;

import com.graducationdesign.springboot.dao.NewsInformationDao;
import com.graducationdesign.springboot.entities.crawling.NewsInformation;
import com.graducationdesign.springboot.service.NewsInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author Mr.zhneg
 * @create 2020-05-22-14:45
 */
@Service
public class NewsInformationServiceImpl implements NewsInformationService {

    //保存招聘信息
@Autowired
    NewsInformationDao newsInformationDao;
    @Override
    @Transactional

    public void save(NewsInformation item) {
        newsInformationDao.save(item);
    }
    //根据条件招聘信息

    @Override
    public List<NewsInformation> findAll(NewsInformation item) {
        //声明查询条件
        Example<NewsInformation> example = Example.of(item);
        return newsInformationDao.findAll(example);
    }

}
